/**
 * Created by IntelliJ IDEA.
 * User: LiuWenqi
 * Date: 2017-12-30
 * Time: 10:46
 * Description:
 */
package com.example.layui.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Module implements Serializable {
    private String url;
    private String permission;
    private String description;
    private String id;
    private String name;
    private String icon;
    private String display;
    private Integer priority;
    private String parentId;
    private List<Module> children ;

    public Module() {
    }

    public Module(String id, String name, String url, String icon, String parentId) {
        this.url = url;
        this.id = id;
        this.name = name;
        this.icon = icon;
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public List<Module> getChildren() {
        return children;
    }

    public void setChildren(List<Module> children) {
        this.children = children;
    }
    public void addChild(Module child) {
        if (children == null) {
            children = new ArrayList<>();
        }

        children.add(child);
    }
}
